package enterprise.web.tookit.message;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * @since 25/12/12
 * 
 * @author regis rocha
 * 
 * @description Classe para enviar informacoes para a view, como mensagem de sucesso, erro ou qualquer tipo de
 *              informacao para enviar ao usuario.
 * 
 */
@XmlRootElement
public class Message implements Serializable {

	// default constructor
	public Message() {
	}

	public Message(boolean pError, Long pCodeError, String pMessage) {
		this.error = pError;
		this.codeError = pCodeError;
		this.messageInformation = pMessage;
	}

	/**
	 * serial version
	 */
	private static final long serialVersionUID = 7151515461987254402L;

	private boolean error;

	private Long codeError;

	private String messageInformation;

	/**
	 * @return the codeError
	 */
	public Long getCodeError() {
		return codeError;
	}

	/**
	 * @param codeError
	 *            the codeError to set
	 */
	public void setCodeError(Long codeError) {
		this.codeError = codeError;
	}

	/**
	 * @return the error
	 */
	public boolean isError() {
		return error;
	}

	/**
	 * @since 25/12/2012
	 * 
	 * @description TRUE para indicar que se refere a um erro.
	 * 
	 * @param boolean
	 * 
	 */
	public void setError(boolean error) {
		this.error = error;
	}

	/**
	 * @return the messageInformation
	 */
	public String getMessageInformation() {
		return messageInformation;
	}

	/**
	 * @param messageInformation
	 *            the messageInformation to set
	 */
	public void setMessageInformation(String messageInformation) {
		this.messageInformation = messageInformation;
	}

}
